package com.taikang.pms.entity;

import com.google.common.base.Objects;
import com.taikang.base.entity.BaseBusLongEntity;

import static com.google.common.base.Preconditions.checkNotNull;

public class Room extends BaseBusLongEntity {

    private String name;

    private Long buildingId;

    private Long communityId;

    private String remark;

    private Integer populationCount;

    private Integer unit;

    private String houseType;

    private String pattern;

    private Double totalArea;

    private Double actualArea;

    private Integer status;

    private Integer sort;


    public String getName() {
        return name;
    }


    public Long getBuildingId() {
        return buildingId;
    }

    public Long getCommunityId() {
        return communityId;
    }

    public String getRemark() {
        return remark;
    }

    public Integer getPopulationCount() {
        return populationCount;
    }

    public Integer getUnit() {
        return unit;
    }

    public String getHouseType() {
        return houseType;
    }

    public String getPattern() {
        return pattern;
    }

    public Double getTotalArea() {
        return totalArea;
    }

    public Double getActualArea() {
        return actualArea;
    }

    public Integer getStatus() {
        return status;
    }

    public Integer getSort() {
        return sort;
    }

    public static Builder aRoom() {
        return new Builder();
    }

    public static class Builder {
        private String name;
        private Long buildingId;
        private Long communityId;
        private String remark;
        private Integer populationCount;
        private Integer unit;
        private String houseType;
        private String pattern;
        private Double totalArea;
        private Double actualArea;
        private Integer status;
        private Integer sort;

        public Builder withName(String name) {
            this.name = name;
            return this;
        }

        public Builder withBuildingId(Long buildingId) {
            this.buildingId = buildingId;
            return this;
        }

        public Builder withCommunityId(Long communityId) {
            this.communityId = communityId;
            return this;
        }

        public Builder withRemark(String remark) {
            this.remark = remark;
            return this;
        }

        public Builder withPopulationCount(Integer populationCount) {
            this.populationCount = populationCount;
            return this;
        }

        public Builder withUnit(Integer unit) {
            this.unit = unit;
            return this;
        }

        public Builder withHouseType(String houseType) {
            this.houseType = houseType;
            return this;
        }

        public Builder withPattern(String pattern) {
            this.pattern = pattern;
            return this;
        }

        public Builder withTotalArea(Double totalArea) {
            this.totalArea = totalArea;
            return this;
        }

        public Builder withActualArea(Double actualArea) {
            this.actualArea = actualArea;
            return this;
        }

        public Builder withStatus(Integer status) {
            this.status = status;
            return this;
        }

        public Builder withSort(Integer sort) {
            this.sort = sort;
            return this;
        }

        public Room build() {
            Room room = new Room();
            room.name = checkNotNull(name);
            room.buildingId = checkNotNull(buildingId);
            room.communityId = checkNotNull(communityId);
            room.unit = checkNotNull(unit);
            room.totalArea = checkNotNull(totalArea);
            room.actualArea = checkNotNull(actualArea);
            room.status = checkNotNull(status);
            return room;
        }
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(name, super.getId());
    }


}